#include <stdio.h>
#include <stdlib.h>

#ifndef QUEUE_H_
#define QUEUE_H_

/*
 *  FILE   : queue.h
 *  AUTHOR : Jeffrey Hunter
 *  WEB    : http://www.iDevelopment.info
 *  NOTES  : Define queue record structure and
 *           all forward declarations.
 *
 *  Obtained from: http://www.idevelopment.info/data/Programming/data_structures/c/Queue/Queue.shtml
 *  Edited by: Michelle Miller
 */

#define Error(Str)        FatalError(Str)
#define FatalError(Str)   fprintf(stderr, "%s\n", Str), exit(1)

typedef void * ElementType;


  struct QueueRecord;
  typedef struct QueueRecord *Queue;

  int         isEmpty(Queue Q);
  int         isFull(Queue Q);
  Queue       createQueue(int MaxElements);
  void        disposeQueue(Queue Q);
  void        makeEmpty(Queue Q);
  void        enqueue(ElementType X, Queue Q);
  ElementType front(Queue Q);
  void        dequeue(Queue Q);
  ElementType frontAndDequeue(Queue Q);
  int 		  size(Queue Q);

#define MinQueueSize (1)

/*****************************************
* Define the queue struct
*****************************************/
struct QueueRecord {
  int Capacity;
  int Front;
  int Rear;
  int Size;
  ElementType * Array;
};


#endif /* QUEUE_H_ */
